package com.dingding.nettyserver.common.trasferrule.response;

/**
 * @Description 结果码的集合
 * @author fengshuonan
 * @date 2016年11月17日 上午11:08:40
 */
public enum ResultCode {
	
	SUCCESS(0,"成功"),
	NO_INVOKER(1,"找不到命令"),
	AGRUMENT_ERROR(2,"参数异常"),
	UNKOWN_EXCEPTION(3,"未知异常"),
	ARGUMENT_NULL(4,"参数为空"),
	NOT_LOGIN(5,"用户未登录");
	
	int code;
	String message;
	
	ResultCode(int code,String message){
		this.code = code;
		this.message = message;
	}
	public int getCode() {
		return code;
	}
	public void setCode(int code) {
		this.code = code;
	}
	public String getMessage() {
		return message;
	}
	public void setMessage(String message) {
		this.message = message;
	}
	public static String messageOf(int value){
		for(ResultCode b : ResultCode.values()){
			if(b.getCode() == value){
				return b.getMessage();
			}
		}
		return "找不到响应吗对应的信息";
	}
	
}
